package cn.catsdad.base.page;

import cn.catsdad.util.StringUtil;

import java.util.Map;

/**
 * 分页查询参数
 *
 * @author xuyl
 * @version V1.0.0 2024/7/8
 * @since V100R001
 */
public abstract class PageParam {

    public String createWhereContent(){
        StringBuilder result = new StringBuilder(" where 1=1 ");
        String condition = getCondition();
        if (StringUtil.isNotEmpty(condition)){
            result.append(condition).append(" ");
        }
        return result.toString();
    }

    public abstract Map<String,Object> getParamMap();

    protected String likeQuery(String param){
        return "%"+param+"%";
    }

    public abstract String getCondition();

}
